﻿<div id="NotifierMainWrapper" style="display: none;">
    <div class="Icon RightCircle CloseIcon" style=""><a class="Icon Fill" href="javascript:NotifierHide();"></a></div>
    <div class="Icon Alert InfoIcon" style="cursor: pointer;" onclick="NotifierShowDetails();"></div>
    <span class="Message"></span>
</div>

<script type="text/javascript">
    var notifierTimeout = 15000;
    var notifierShowTimeoutId = -1;
    var notifierMainWrapperJq = $('#NotifierMainWrapper');
    var messageJq = notifierMainWrapperJq.children('.Message');
    function NotifierShow(message, detailsMesssage) {
        clearTimeout(notifierShowTimeoutId);
        var currentMessage = $.trim(messageJq.html());
        messageJq.html(currentMessage == '' ? message : currentMessage + "<br /><br />" + message);
        notifierMainWrapperJq.fadeIn(globalAnimationDuration / 3);
        notifierShowTimeoutId = setTimeout(NotifierHide, notifierTimeout);
        if (detailsMesssage) {
            messageJq.append('<span class="Details" style="display: none; text-align: right;"><br /><br />' + detailsMesssage + '</span>');
        }
    };

    function NotifierShowDetails() {
        clearTimeout(notifierShowTimeoutId);
        notifierMainWrapperJq.find(".Message .Details").fadeIn(globalAnimationDuration / 3, function () {
            notifierShowTimeoutId = setTimeout(NotifierHide, notifierTimeout);
        });
    };

    function NotifierHide() {
        clearTimeout(notifierShowTimeoutId);
        notifierMainWrapperJq.fadeOut(globalAnimationDuration / 3, function () {
            messageJq.html('');
        });
    };
</script>